﻿//********************************************************************
// Author:      Cxq
// Create Date: 2012-08-25
// Description: 
//
// Version:     1.0.0.0
// Change History:
// Date		    Who		      Changes Maded
//--------------------------------------------------------------------
// Please Insert the Modiy record here!
//--------------------------------------------------------------------
//********************************************************************



using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Xml.Serialization;
using MillerApp.DataContract.Common;
using MillerApp.DataContract.Common.Entity;


namespace MillerApp.DataContract.MillerDB
{
    #region stockquotationsEntity
    /// <summary>
    /// 这个实体提供了 stockquotationsEntity ()的属性和方法.
    /// </summary>
    [DataContract]
    public partial class StockquotationsEntity : BaseEntity<StockquotationsEntity>, IEquatable<StockquotationsEntity>
    {
        #region Properties
        private int _id;
        /// <summary>
        /// 获取或设置id integer NotAllowDBNull
        /// </summary>
        [DataMember]
        public int id
        {
            get { return _id; }
            set
            {
                _id = value;
                //NotifyPropertyChange("id");
            }
        }

        private decimal? _outflowretail;
        /// <summary>
        /// 获取或设置outflowretail numeric(20, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? outflowretail
        {
            get { return _outflowretail; }
            set
            {
                _outflowretail = value;
                //NotifyPropertyChange("outflowretail");
            }
        }

        private decimal? _inflowretail;
        /// <summary>
        /// 获取或设置inflowretail numeric(20, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? inflowretail
        {
            get { return _inflowretail; }
            set
            {
                _inflowretail = value;
                //NotifyPropertyChange("inflowretail");
            }
        }

        private decimal? _outflowmain;
        /// <summary>
        /// 获取或设置outflowmain numeric(20, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? outflowmain
        {
            get { return _outflowmain; }
            set
            {
                _outflowmain = value;
                //NotifyPropertyChange("outflowmain");
            }
        }

        private decimal? _inflowmain;
        /// <summary>
        /// 获取或设置inflowmain numeric(20, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? inflowmain
        {
            get { return _inflowmain; }
            set
            {
                _inflowmain = value;
                //NotifyPropertyChange("inflowmain");
            }
        }

        private decimal? _changeratio;
        /// <summary>
        /// 获取或设置changeratio numeric(10, 8) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? changeratio
        {
            get { return _changeratio; }
            set
            {
                _changeratio = value;
                //NotifyPropertyChange("changeratio");
            }
        }

        private decimal? _turnoverrate;
        /// <summary>
        /// 获取或设置turnoverrate numeric(8, 6) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? turnoverrate
        {
            get { return _turnoverrate; }
            set
            {
                _turnoverrate = value;
                //NotifyPropertyChange("turnoverrate");
            }
        }

        private DateTime? _modifytime;
        /// <summary>
        /// 获取或设置modifytime date AllowDBNull
        /// </summary>
        [DataMember]
        public DateTime? modifytime
        {
            get { return _modifytime; }
            set
            {
                _modifytime = value;
                //NotifyPropertyChange("modifytime");
            }
        }

        private DateTime? _createtime;
        /// <summary>
        /// 获取或设置createtime date AllowDBNull
        /// </summary>
        [DataMember]
        public DateTime? createtime
        {
            get { return _createtime; }
            set
            {
                _createtime = value;
                //NotifyPropertyChange("createtime");
            }
        }

        private decimal? _sellingprice5;
        /// <summary>
        /// 获取或设置sellingprice5 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingprice5
        {
            get { return _sellingprice5; }
            set
            {
                _sellingprice5 = value;
                //NotifyPropertyChange("sellingprice5");
            }
        }

        private decimal? _sellingvolume5;
        /// <summary>
        /// 获取或设置sellingvolume5 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingvolume5
        {
            get { return _sellingvolume5; }
            set
            {
                _sellingvolume5 = value;
                //NotifyPropertyChange("sellingvolume5");
            }
        }

        private decimal? _sellingprice4;
        /// <summary>
        /// 获取或设置sellingprice4 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingprice4
        {
            get { return _sellingprice4; }
            set
            {
                _sellingprice4 = value;
                //NotifyPropertyChange("sellingprice4");
            }
        }

        private decimal? _sellingvolume4;
        /// <summary>
        /// 获取或设置sellingvolume4 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingvolume4
        {
            get { return _sellingvolume4; }
            set
            {
                _sellingvolume4 = value;
                //NotifyPropertyChange("sellingvolume4");
            }
        }

        private decimal? _sellingprice3;
        /// <summary>
        /// 获取或设置sellingprice3 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingprice3
        {
            get { return _sellingprice3; }
            set
            {
                _sellingprice3 = value;
                //NotifyPropertyChange("sellingprice3");
            }
        }

        private decimal? _sellingvolume3;
        /// <summary>
        /// 获取或设置sellingvolume3 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingvolume3
        {
            get { return _sellingvolume3; }
            set
            {
                _sellingvolume3 = value;
                //NotifyPropertyChange("sellingvolume3");
            }
        }

        private decimal? _sellingprice2;
        /// <summary>
        /// 获取或设置sellingprice2 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingprice2
        {
            get { return _sellingprice2; }
            set
            {
                _sellingprice2 = value;
                //NotifyPropertyChange("sellingprice2");
            }
        }

        private decimal? _sellingvolume2;
        /// <summary>
        /// 获取或设置sellingvolume2 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingvolume2
        {
            get { return _sellingvolume2; }
            set
            {
                _sellingvolume2 = value;
                //NotifyPropertyChange("sellingvolume2");
            }
        }

        private decimal? _sellingprice1;
        /// <summary>
        /// 获取或设置sellingprice1 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingprice1
        {
            get { return _sellingprice1; }
            set
            {
                _sellingprice1 = value;
                //NotifyPropertyChange("sellingprice1");
            }
        }

        private decimal? _sellingvolume1;
        /// <summary>
        /// 获取或设置sellingvolume1 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? sellingvolume1
        {
            get { return _sellingvolume1; }
            set
            {
                _sellingvolume1 = value;
                //NotifyPropertyChange("sellingvolume1");
            }
        }

        private decimal? _buyingprice5;
        /// <summary>
        /// 获取或设置buyingprice5 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingprice5
        {
            get { return _buyingprice5; }
            set
            {
                _buyingprice5 = value;
                //NotifyPropertyChange("buyingprice5");
            }
        }

        private decimal? _buyingvolume5;
        /// <summary>
        /// 获取或设置buyingvolume5 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingvolume5
        {
            get { return _buyingvolume5; }
            set
            {
                _buyingvolume5 = value;
                //NotifyPropertyChange("buyingvolume5");
            }
        }

        private decimal? _buyingprice4;
        /// <summary>
        /// 获取或设置buyingprice4 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingprice4
        {
            get { return _buyingprice4; }
            set
            {
                _buyingprice4 = value;
                //NotifyPropertyChange("buyingprice4");
            }
        }

        private decimal? _buyingvolume4;
        /// <summary>
        /// 获取或设置buyingvolume4 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingvolume4
        {
            get { return _buyingvolume4; }
            set
            {
                _buyingvolume4 = value;
                //NotifyPropertyChange("buyingvolume4");
            }
        }

        private decimal? _buyingprice3;
        /// <summary>
        /// 获取或设置buyingprice3 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingprice3
        {
            get { return _buyingprice3; }
            set
            {
                _buyingprice3 = value;
                //NotifyPropertyChange("buyingprice3");
            }
        }

        private decimal? _buyingvolume3;
        /// <summary>
        /// 获取或设置buyingvolume3 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingvolume3
        {
            get { return _buyingvolume3; }
            set
            {
                _buyingvolume3 = value;
                //NotifyPropertyChange("buyingvolume3");
            }
        }

        private decimal? _buyingprice2;
        /// <summary>
        /// 获取或设置buyingprice2 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingprice2
        {
            get { return _buyingprice2; }
            set
            {
                _buyingprice2 = value;
                //NotifyPropertyChange("buyingprice2");
            }
        }

        private decimal? _buyingvolume2;
        /// <summary>
        /// 获取或设置buyingvolume2 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingvolume2
        {
            get { return _buyingvolume2; }
            set
            {
                _buyingvolume2 = value;
                //NotifyPropertyChange("buyingvolume2");
            }
        }

        private decimal? _buyingprice1;
        /// <summary>
        /// 获取或设置buyingprice1 numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingprice1
        {
            get { return _buyingprice1; }
            set
            {
                _buyingprice1 = value;
                //NotifyPropertyChange("buyingprice1");
            }
        }

        private decimal? _buyingvolume1;
        /// <summary>
        /// 获取或设置buyingvolume1 numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? buyingvolume1
        {
            get { return _buyingvolume1; }
            set
            {
                _buyingvolume1 = value;
                //NotifyPropertyChange("buyingvolume1");
            }
        }

        private decimal? _reserveprice;
        /// <summary>
        /// 获取或设置reserveprice numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? reserveprice
        {
            get { return _reserveprice; }
            set
            {
                _reserveprice = value;
                //NotifyPropertyChange("reserveprice");
            }
        }

        private decimal? _competitiveprice;
        /// <summary>
        /// 获取或设置competitiveprice numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? competitiveprice
        {
            get { return _competitiveprice; }
            set
            {
                _competitiveprice = value;
                //NotifyPropertyChange("competitiveprice");
            }
        }

        private decimal? _tradingmoneyvolume;
        /// <summary>
        /// 获取或设置tradingmoneyvolume numeric(20, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? tradingmoneyvolume
        {
            get { return _tradingmoneyvolume; }
            set
            {
                _tradingmoneyvolume = value;
                //NotifyPropertyChange("tradingmoneyvolume");
            }
        }

        private decimal? _tradingvolume;
        /// <summary>
        /// 获取或设置tradingvolume numeric(18, 0) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? tradingvolume
        {
            get { return _tradingvolume; }
            set
            {
                _tradingvolume = value;
                //NotifyPropertyChange("tradingvolume");
            }
        }

        private decimal? _todaylowestprice;
        /// <summary>
        /// 获取或设置todaylowestprice numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? todaylowestprice
        {
            get { return _todaylowestprice; }
            set
            {
                _todaylowestprice = value;
                //NotifyPropertyChange("todaylowestprice");
            }
        }

        private decimal? _todayhighestprice;
        /// <summary>
        /// 获取或设置todayhighestprice numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? todayhighestprice
        {
            get { return _todayhighestprice; }
            set
            {
                _todayhighestprice = value;
                //NotifyPropertyChange("todayhighestprice");
            }
        }

        private decimal? _todayclosingprice;
        /// <summary>
        /// 获取或设置todayclosingprice numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? todayclosingprice
        {
            get { return _todayclosingprice; }
            set
            {
                _todayclosingprice = value;
                //NotifyPropertyChange("todayclosingprice");
            }
        }

        private decimal? _yesterdayclosingprice;
        /// <summary>
        /// 获取或设置yesterdayclosingprice numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? yesterdayclosingprice
        {
            get { return _yesterdayclosingprice; }
            set
            {
                _yesterdayclosingprice = value;
                //NotifyPropertyChange("yesterdayclosingprice");
            }
        }

        private decimal? _todayopeningprice;
        /// <summary>
        /// 获取或设置todayopeningprice numeric(9, 3) AllowDBNull
        /// </summary>
        [DataMember]
        public decimal? todayopeningprice
        {
            get { return _todayopeningprice; }
            set
            {
                _todayopeningprice = value;
                //NotifyPropertyChange("todayopeningprice");
            }
        }

        private DateTime? _tradeday;
        /// <summary>
        /// 获取或设置tradeday date AllowDBNull
        /// </summary>
        [DataMember]
        public DateTime? tradeday
        {
            get { return _tradeday; }
            set
            {
                _tradeday = value;
                //NotifyPropertyChange("tradeday");
            }
        }

        private string _seccode = String.Empty;
        /// <summary>
        /// 获取或设置seccode character(6) AllowDBNull
        /// </summary>
        [DataMember]
        public string seccode
        {
            get { return _seccode; }
            set
            {
                _seccode = value;
                //NotifyPropertyChange("seccode");
            }
        }


        #endregion

        /// <summary>
        /// 构造函数
        /// </summary>
        public StockquotationsEntity()
        {
        }

        #region IEquatable<stockquotationsEntity> 成员
        /// <summary>
        /// 比较两个实例数据库表中的字段是否相等
        /// </summary>
        /// <param name="other">stockquotationsEntity</param>
        /// <returns>bool</returns>
        public bool Equals(StockquotationsEntity other)
        {
            return this.id.Equals(other.id) && this.outflowretail.Equals(other.outflowretail) && this.inflowretail.Equals(other.inflowretail) && this.outflowmain.Equals(other.outflowmain) && this.inflowmain.Equals(other.inflowmain) && this.changeratio.Equals(other.changeratio) && this.turnoverrate.Equals(other.turnoverrate) && this.modifytime.Equals(other.modifytime) && this.createtime.Equals(other.createtime) && this.sellingprice5.Equals(other.sellingprice5) && this.sellingvolume5.Equals(other.sellingvolume5) && this.sellingprice4.Equals(other.sellingprice4) && this.sellingvolume4.Equals(other.sellingvolume4) && this.sellingprice3.Equals(other.sellingprice3) && this.sellingvolume3.Equals(other.sellingvolume3) && this.sellingprice2.Equals(other.sellingprice2) && this.sellingvolume2.Equals(other.sellingvolume2) && this.sellingprice1.Equals(other.sellingprice1) && this.sellingvolume1.Equals(other.sellingvolume1) && this.buyingprice5.Equals(other.buyingprice5) && this.buyingvolume5.Equals(other.buyingvolume5) && this.buyingprice4.Equals(other.buyingprice4) && this.buyingvolume4.Equals(other.buyingvolume4) && this.buyingprice3.Equals(other.buyingprice3) && this.buyingvolume3.Equals(other.buyingvolume3) && this.buyingprice2.Equals(other.buyingprice2) && this.buyingvolume2.Equals(other.buyingvolume2) && this.buyingprice1.Equals(other.buyingprice1) && this.buyingvolume1.Equals(other.buyingvolume1) && this.reserveprice.Equals(other.reserveprice) && this.competitiveprice.Equals(other.competitiveprice) && this.tradingmoneyvolume.Equals(other.tradingmoneyvolume) && this.tradingvolume.Equals(other.tradingvolume) && this.todaylowestprice.Equals(other.todaylowestprice) && this.todayhighestprice.Equals(other.todayhighestprice) && this.todayclosingprice.Equals(other.todayclosingprice) && this.yesterdayclosingprice.Equals(other.yesterdayclosingprice) && this.todayopeningprice.Equals(other.todayopeningprice) && this.tradeday.Equals(other.tradeday) && this.seccode.Equals(other.seccode);
        }

        #endregion

        #region IDataKey 成员


        #endregion

        #region 自定义

        public decimal tradingvolume2
        {
            get
            {
                if (this._tradingvolume == null)
                {
                    return 0;
                }
                return this._tradingvolume.Value / (100*10000);
            }
        }

        public decimal tradingmoneyvolume2
        {
            get
            {
                if (this._tradingmoneyvolume == null)
                {
                    return 0;
                }
                return this._tradingmoneyvolume.Value / (10000*10000);
            }
        }

        [DataMember]
        public string changeratioString
        {
            get
            {
                return Common.NumericHelper.GetNumericFormatString(this._changeratio, NumericHelper.NumericFormat.Percent, true, 2);
            }
        }
        [DataMember]
        public string turnoverrateString
        {
            get
            {
                //106.589
                if (this._turnoverrate == null)
                {
                    return string.Empty;
                }
                return Common.NumericHelper.GetNumericFormatString(this._turnoverrate / 10000, NumericHelper.NumericFormat.Percent, true, 2);
            }
        }
        public decimal? mainflow
        {
            get
            {
                return _inflowmain - _outflowmain;
            }
        }
        public decimal? retailflow
        {
            get
            {
                return _inflowretail - _outflowretail;
            }
        }
        public decimal? allflow
        {
            get
            {
                return mainflow + retailflow;
            }
        }

        public string secshortname { get; set; }

        public string compindustryname { get; set; }
        #endregion
    }

    #endregion
}
